package com.mask.bank.entityWapper;

import com.mask.bank.entity.AccountEntity;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * ClassName AccountRowMapper
 * Create by hx
 * Date 2021/9/19 2:21 下午
 */

public class AccountRowMapper implements RowMapper<AccountEntity> {
    @Override
    public AccountEntity mapRow(ResultSet resultSet, int i) throws SQLException {
        String name = resultSet.getString("name");
        String cardNumbers = resultSet.getString("card_numbers");
        double money = resultSet.getDouble("money");
        AccountEntity accountEntity = new AccountEntity(name,  money,cardNumbers);
        return accountEntity;
    }
}
